package procedure;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sk.z
 */
public class Main {

    public static void main(String[] args) {
        Node process = TestProcess.A();
        Show.process(process);

        //分支合并
        while (MergeSubProcess.of(process)){
            Show.process(process);
        }
        Show.process(process);

        //最终产能计算
        List<Node> list = new ArrayList<>();
        Node cur = process;
        if (cur.getType()!=0){  //排除虚拟空点
            list.add(cur);
        }
        while (cur.getAfterList().size()>0){
            cur = cur.getAfterList().get(0);
            list.add(cur);
        }
        Node sumNode = Calculate.mergeSerial(list);
        System.out.println("最终产能:"+sumNode.toString());
    }

}
